package com.xbongbong.saas.model;

import com.xbongbong.saas.domain.entity.LikeEntity;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/2/27 19:54
 * @since v1.0
 */
public interface LikeModel {
    /**
     * 计数
     * @param map
     */
    Integer getEntitysCount(Map<String,Object> map);

    /**
     * 点赞
     * @param likeEntity
     */
    void save(LikeEntity likeEntity);

    List<LikeEntity> findEntitys(Map<String,Object> map);

    /**
     * 点赞总数map
     * 从LikeService内移入
     * @param dataIdIn 业务ids
     * @param corpid 公司id
     * @param code 业务类型 @see BusinessCommentEnum
     * @return java.util.Map<java.lang.Long,java.lang.Integer>
     * @author zcp
     * @date 2019/5/12 16:52
     * @since v1.0
     * @version v1.0
     */
    Map<Long,Integer> getLikeCountMap(Collection<Long> dataIdIn, String corpid, Integer code);

    /**
     * 获取我点赞的数据
     * @param dataIdIn 业务ids
     * @param corpid 公司id
     * @param code 业务类型 @see BusinessCommentEnum
     * @param userId 员工userId
     * @return java.util.List<java.lang.Long>
     * @author zcp
     * @date 2019/5/12 17:01
     * @since v1.0
     * @version v1.0
     */
    List<Long> hasMyLike(Collection<Long> dataIdIn, String corpid, Integer code, String userId);

    Integer dataConsistencyUpdateUser(String corpid, String userId, String userName, String userAvatar);

    void insertBatch(List<LikeEntity> list);
}
